import request from '@/utils/request'

const baseUrl = '/zt-funds/ztyh/funds'

//商品列表
export const getFunds = (page, limit, from) => {
  return request({
    url: baseUrl + '/findFunds/' + page + '/' + limit,
    method: 'get',
    params: from,
  })
}

//商品详情
export const getFundsInfo = id => {
  return request({
    url: baseUrl + '/findFundsInfo/' + id,
    method: 'get',
  })
}

//自己的理财
export const findByUser = (page,limit,form) => {
  return request({
    url: baseUrl + '/findByUser/' +page+"/"+limit,
    method: 'get',
    params: form,
  })
}

//赎回
export const updateFunds = data => {
  return request({
    url: baseUrl + '/updateFunds',
    method: 'put',
    data,
  })
}

//购买
export const getAddFunds = data => {
  return request({
    url: baseUrl + '/buyFunds',
    method: 'post',
    data,
  })
}
